#pragma once
#include "Win32.h"

#include <d3d9.h>
#include <d3dx9.h>
#include <dxerr9.h>
#include <string>
#include <sstream>

#if defined(DEBUG) | defined(_DEBUG)
#ifndef D3D_DEBUG_INFO
#define D3D_DEBUG_INFO
#endif
#ifndef HR
	#define HR(x)                                      \
	{                                                  \
		HRESULT hr = x;                                \
		if(FAILED(hr))                                 \
		{                                              \
			DXTrace(__FILE__, __LINE__, hr, #x, TRUE); \
		}                                              \
	}
	#else
		#ifndef HR
		#define HR(x) x;
		#endif
#endif
#endif
//Thanks to Frank D. Luna for this macro

class CD3d9App
{
public:
	CD3d9App(void);
	virtual ~CD3d9App(void);

	bool init(int widith , int height) ;

	int run() ;
	//onLostDevice() ;
	//onResetDevice() ;
	//onUpdate() ;
	//onFrame(float dt) ;
private:
	IDirect3D9*			m_md3Object ;
	IDirect3DDevice9*	m_d3dDevice ;
	CWin32*				m_appObject ;

	int					m_widith ;
	int					m_height ;
};
